<html>
<head><meta charset="utf-8"><title>const-generics: coerce of `[usize; 0] -&gt; [usize; 0]` fails · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html">const-generics: coerce of `[usize; 0] -&gt; [usize; 0]` fails</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="193602000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193602000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193602000">(Apr 10 2020 at 18:32)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="cp">#![feature(const_generics)]</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">Const</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">V</span>: <span class="p">[</span><span class="kt">usize</span><span class="p">;</span><span class="w"> </span><span class="mi">0</span><span class="p">]</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">type</span> <span class="nc">MyConst</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Const</span><span class="o">&lt;</span><span class="p">{</span><span class="w"> </span><span class="p">[]</span><span class="w"> </span><span class="p">}</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Const</span>::<span class="o">&lt;</span><span class="p">{</span><span class="w"> </span><span class="p">[]</span><span class="w"> </span><span class="p">}</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{};</span><span class="w"> </span><span class="c1">// ERROR</span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MyConst</span><span class="w"> </span><span class="p">{};</span><span class="w"> </span><span class="c1">// ERROR</span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>currently fails in <code>try_coerce</code>(<a href="https://github.com/rust-lang/rust/blob/dbc3cfdd25ccd56edf3ea364f86ab32967636c26/src/librustc_typeck/check/coercion.rs#L813" title="https://github.com/rust-lang/rust/blob/dbc3cfdd25ccd56edf3ea364f86ab32967636c26/src/librustc_typeck/check/coercion.rs#L813">https://github.com/rust-lang/rust/blob/dbc3cfdd25ccd56edf3ea364f86ab32967636c26/src/librustc_typeck/check/coercion.rs#L813</a>)<br>
for </p>
<div class="codehilite"><pre><span></span>coercion::try(
   Expr {
       hir_id: HirId { owner: DefId(0:8 ~ whooosagoodboi[317d]::main[0]), local_id: 6 },
       kind: Block(Block { stmts: [],
       expr: Some(
            Expr { hir_id: HirId { owner: DefId(0:8 ~ whooosagoodboi[317d]::main[0]), local_id: 4 }, kind: Array([]), attrs: ThinVec(None), span: //home/programming/rust/src/test/ui/__check/whooosagoodboi.rs:9:24: 9:26 }),
       hir_id: HirId { owner: DefId(0:8 ~ whooosagoodboi[317d]::main[0]), local_id: 5 }, rules: DefaultBlock, span: /home/programming/rust/src/test/ui/__check/whooosagoodboi.rs:9:22: 9:28, targeted_by_break: false }, None ),
        attrs: ThinVec(None),
        span: /home/programming/rust/src/test/ui/__check/whooosagoodboi.rs:9:22: 9:28
    }: [usize; 0] -&gt; [usize; 0]
)
</pre></div>


<p>It seems to try <code>coerce_unsized</code> which then fails.</p>
<p>While I am currently looking into this myself, <span class="user-mention" data-user-id="119009">@eddyb</span>  <span class="user-mention" data-user-id="121053">@varkor</span> do you have some ideas why this might happen?</p>



<a name="193602030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193602030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193602030">(Apr 10 2020 at 18:32)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/68615" title="https://github.com/rust-lang/rust/issues/68615">https://github.com/rust-lang/rust/issues/68615</a></p>



<a name="193602119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193602119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193602119">(Apr 10 2020 at 18:33)</a>:</h4>
<p>nope, other than the types being wrong <em>some time earlier</em></p>



<a name="193603427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193603427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193603427">(Apr 10 2020 at 18:45)</a>:</h4>
<p>nevermind, it fails one call later when trying to coerce <code>[usize; 0] -&gt; _</code> for whatever reason <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="193605716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193605716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193605716">(Apr 10 2020 at 19:06)</a>:</h4>
<p>What is the meaning of <code>use_lub</code>? <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/coercion/struct.Coerce.html#structfield.use_lub" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/coercion/struct.Coerce.html#structfield.use_lub">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/coercion/struct.Coerce.html#structfield.use_lub</a></p>



<a name="193605887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193605887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193605887">(Apr 10 2020 at 19:07)</a>:</h4>
<p><code>Least upper bound</code> i guess <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="193606247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193606247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193606247">(Apr 10 2020 at 19:10)</a>:</h4>
<p>coercion has a horrible stack depth <span aria-label="neutral" class="emoji emoji-1f610" role="img" title="neutral">:neutral:</span> at least when inspecting it for the first time</p>



<a name="193606349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193606349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193606349">(Apr 10 2020 at 19:11)</a>:</h4>
<p><code>use_lub</code> is for when you have e.g. <code>[x, y]</code> and so <code>x</code> and <code>y</code>'s types have to merge into a common type</p>



<a name="193606362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193606362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193606362">(Apr 10 2020 at 19:11)</a>:</h4>
<p>and Rust has subtyping</p>



<a name="193618287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193618287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193618287">(Apr 10 2020 at 21:13)</a>:</h4>
<p>ayy! progress <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/combine/struct.CombineFields.html#method.instantiate" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/combine/struct.CombineFields.html#method.instantiate">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/combine/struct.CombineFields.html#method.instantiate</a> returns <code>ConstMismatch</code> with with expected == found...</p>



<a name="193624043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624043">(Apr 10 2020 at 22:13)</a>:</h4>
<p>fk <a href="https://github.com/rust-lang/rust/blob/9682f0e14db95076454559a24c26287bcad57955/src/librustc_middle/ty/relate.rs#L562" title="https://github.com/rust-lang/rust/blob/9682f0e14db95076454559a24c26287bcad57955/src/librustc_middle/ty/relate.rs#L562">https://github.com/rust-lang/rust/blob/9682f0e14db95076454559a24c26287bcad57955/src/librustc_middle/ty/relate.rs#L562</a><br>
the last 5 hours weren't as productive as I have hoped.</p>



<a name="193624303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624303">(Apr 10 2020 at 22:16)</a>:</h4>
<p>lol</p>



<a name="193624318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624318">(Apr 10 2020 at 22:16)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> Can we just compare the relevant section of the allocations here?</p>



<a name="193624323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624323">(Apr 10 2020 at 22:16)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@Bastian Kauschke</span> maybe look at <code>destructure_const</code>?</p>



<a name="193624330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624330">(Apr 10 2020 at 22:16)</a>:</h4>
<p>what are you trying to fix?</p>



<a name="193624338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624338">(Apr 10 2020 at 22:17)</a>:</h4>
<p><code>0</code> can't be <code>ByRef</code></p>



<a name="193624348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624348">(Apr 10 2020 at 22:17)</a>:</h4>
<p>this <a href="https://github.com/rust-lang/rust/issues/68615" title="https://github.com/rust-lang/rust/issues/68615">https://github.com/rust-lang/rust/issues/68615</a></p>



<a name="193624372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624372">(Apr 10 2020 at 22:17)</a>:</h4>
<p><code>[DEBUG rustc_middle::ty::relate] super_relate_tys: a=Foo&lt;ByRef { alloc: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: [usize; 0]&gt; b=Foo&lt;ByRef { alloc: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: [usize; 0]&gt;
</code></p>



<a name="193624379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624379">(Apr 10 2020 at 22:17)</a>:</h4>
<p>aaaaaaaah</p>



<a name="193624421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624421">(Apr 10 2020 at 22:18)</a>:</h4>
<p>named <code>Const</code> to <code>Foo</code> in this log</p>



<a name="193624426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624426">(Apr 10 2020 at 22:18)</a>:</h4>
<p>it's an <code>[]: [usize; 0]</code> value</p>



<a name="193624430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624430">(Apr 10 2020 at 22:18)</a>:</h4>
<p>not a <code>[usize; 0]</code> type</p>



<a name="193624442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624442">(Apr 10 2020 at 22:18)</a>:</h4>
<p>yeah okay <code>ByRef</code></p>



<a name="193624453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624453">(Apr 10 2020 at 22:18)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@Bastian Kauschke</span> check out <code>destructure_const</code> ;;)</p>



<a name="193624508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624508">(Apr 10 2020 at 22:19)</a>:</h4>
<p>I have an unfinished PR to use it to print consts nicely</p>



<a name="193624516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624516">(Apr 10 2020 at 22:19)</a>:</h4>
<p>maybe you want to wait for that? idk</p>



<a name="193624856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/const-generics%3A%20coerce%20of%20%60%5Busize%3B%200%5D%20-%3E%20%5Busize%3B%200%5D%60%20fails/near/193624856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/const-generics.3A.20coerce.20of.20.60.5Busize.3B.200.5D.20-.3E.20.5Busize.3B.200.5D.60.20fails.html#193624856">(Apr 10 2020 at 22:23)</a>:</h4>
<blockquote>
<p>maybe you want to wait for that? idk</p>
</blockquote>
<p>This should be a fairly straightforward fix now afaict <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> <br>
I think I will at least try this without waiting.</p>
<p>Good night. I am done for today <span aria-label="exhausted" class="emoji emoji-1f625" role="img" title="exhausted">:exhausted:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>